-
Notifications
You must be signed in to change notification settings - Fork 337
[Wrangler Ignore option 2] exclude/include logic in wrangler.toml for static asset uploads #760
Conversation
…till needs wildcard and directory support
…le. This approach should be readily applicable to .wignore logic down the line
* Add message for file ignore * Only build asset manifest once (#717) * Add AssetManifest type * Only manifest building logic once
…till needs wildcard and directory support
…le. This approach should be readily applicable to .wignore logic down the line
* Add message for file ignore * Only build asset manifest once (#717) * Add AssetManifest type * Only manifest building logic once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good!
There are a couple of things I noticed while testing this:
- There is no output that lets you know what files it is ignoring (perhaps a
--verbose
would be good?) - At first I tried excluding directories with relative paths (
./img
) but that didn't work - perhaps if something can't be parsed in the include/exclude we should bail before uploading stuff they might want to exclude - If you put in a string instead of a sequence, the error message isn't the best (but you can probably still figure stuff out)
$ wrangler publish
Error: invalid type: string "./img", expected a sequence
- it might be useful to have some
log::info
orlog::debug
statements - especially for things like the default to ignorenode_modules
@EverlastingBugstopper responding to questions:
|
Makes sense - re no. 2, do you think it makes sense to print a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@EverlastingBugstopper I might wait until we see a ticket related to include/exclude entries starting with |
This PR is the secondary implementation/option to close #716. The first option is #720.
Wrangler will look at
wrangler.toml
'ssite
section for fields to ignore:The include and exclude fields will apply to the
bucket
directory. Its behavior above is exactly the same as https://github.com/ashleygwilliams/cargo-generate#include--exclude (this is also the standard for cargo).Keep in mind that, consistent with other implementations of include/exclude, the include field always overrides the exclude one.
This PR also contains a bunch of unit tests to ensure that our exclude/include logic works as expected.